
  <div class="layui-form" id="form-cont">
    <div class="layui-form-item">
      <label class="layui-form-label">登录名</label>
      <div class="layui-input-inline">
        <input type="text" name="agent_name" lay-verType="tips" lay-verify="required" autocomplete="off" class="layui-input"/>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">姓名</label>
      <div class="layui-input-inline">
        <input type="text" name="real_name" lay-verType="tips" lay-verify="required" class="layui-input"/>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">电话</label>
      <div class="layui-input-inline">
        <input type="text" name="agent_tel" v-model="hxr_agent.agent_tel" class="layui-input"/>
      </div>
    </div>
	<div class="layui-form-item">
	  <label class="layui-form-label">邮箱</label>
	  <div class="layui-input-inline">
	    <input type="text" name="agent_email" v-model="hxr_agent.agent_email" class="layui-input"/>
	  </div>
	</div>
    <div class="layui-form-item">
      <label class="layui-form-label"></label>
      <div class="layui-input-inline">
		  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
      </div>
    </div>
  </div>
 
<script type="text/javascript">
	layui.use(['admin','form'], function(admin,form){
	  var $ = layui.$
	  ,form = layui.form;
	  
	  var formCont=new Vue({
	  	el:'#form-cont',
	  	data:{
	  		hxr_agent:{}
	  	},
	  	created() {
	  		if(layui.admin.objData.type==2){
	  			this.hxr_agent=layui.admin.objData.detail;
	  		}
	  		/* layui.admin.ajax().then((res)=>{

	  		}).catch((res)=>{
	  			
	  		}) */
			form.on('submit(formDemo)', function(data){

				layer.load(1);
				setTimeout(res=>{
					layer.closeAll()
					layui.table.reload('test-table-height');
				},1000)
			    return false;
			});
	  	},
	  	methods:{
	  		/* submit(){

	  			layer.closeAll()
	  			layui.table.reload('test-table-height');
	  		} */
	  	}
	  })
	})
</script>
